{include file="admin@public/header" /}
{block name="style"}{/block}
<script type="text/javascript">


function SwitchFun(wxmpid){
	var url = "{:url('admin/index/switch')}"
	if (wxmpid)
	{
		$.ajax({
             type: "GET",
             url: url,
             data: {wxmpid:wxmpid},
             dataType: "json",
             success: function(data){
				if (data.code==200)
				{
					window.location.reload();
				}else{
					updateAlert('切换失败', 'error');

				}
			}
        });
	}
	
}

//点击页面其他地方关闭

document.onclick = function (e) {
    if(!$(e.target).is("#more") && $(".switch-mp").is(":visible")==true){
        $(".switch-mp").hide();
    }
	if ($(e.target).is("#more") && $(".switch-mp").is(":visible")===false)
	{
		
		$(".switch-mp").show();
	}
}

</script>
<div id="theme-wrapper">
	<header class="navbar" id="header-navbar">
		<div class="container">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#header-nav">
					<span class="sr-only">菜单</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<a href="{:url('admin/index/index')}" id="logo" class="navbar-brand">分销平台
				</a>
				{notempty name=":session('wxmpid')"}<button type="button" class="ant-btn clearfix" style="width: 140px; text-align: left; line-height: 26px;margin-top:10px" id="more" ><span class="btn-mp-text">{:session('webname')}</span><i class="fa fa-chevron-down pull-right" style="margin-top: 6px;"></i></button>{/notempty}
				<div class="switch-mp" style="display:none">
					<div class="switch-mp__cover"></div>
					<div class="switch-mp__main">
						<div class="mt">
						    
						{volist name="site" id="vo"}
							<button {if session('wxmpid')==$vo['id']}disabled{else}onclick="SwitchFun({$vo['id']})"{/if} type="button" class="ant-btn switch-mp__item "><span>{$vo.webname}</span></button>
						{/volist}
						
						</div>
					</div>
				</div>
				<!---
				<ul class="nav navbar-nav pull-right visible-xs">
					<li class="dropdown profile-dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown">
							<img src="__PUBLIC__/images/samples/scarlet-159.png" alt=""/>
							<span class="hidden-xs">{:session('user_auth.username')}</span> <b class="caret"></b>
						</a>
						<ul class="dropdown-menu dropdown-menu-right">
							<li>
								<a href="{:url('admin/User/info')}">
									<i class="fa fa-user"></i>
									个人资料
								</a>
							</li>
							<li>
								<a href="{:url('admin/User/editpwd')}">
									<i class="fa fa-cog"></i>
									修改密码
								</a>
							</li>
							<li>
								<a href="{:url('admin/index/logout')}">
									<i class="fa fa-power-off"></i>
									安全退出
								</a>
							</li>
							<li>
								<a href="{:config('WEB_SITE_URL')}" target="_blank">
									<i class="fa fa-home"></i>
									前台首页
								</a>
							</li>
						</ul>
					</li>
				</ul>
				--->
			</div>

			
			<div class="collapse navbar-collapse" id="header-nav" style="margin:0;padding:0">
				<ul class="nav navbar-nav">
					
				</ul>
				<ul class="nav navbar-nav pull-right">
					
					<li>
						<a href="{:url('admin/agent/article')}">
							<i class="fa fa-commenting-o"></i>
							消息
						</a>
					</li>
					
					<li>
						<a href="{:url('admin/User/info')}">
							<i class="fa fa-user"></i>
							个人资料
						</a>
					</li>
					<li>
						<a href="{:url('admin/User/editpwd')}">
							<i class="fa fa-cog"></i>
							修改密码
						</a>
					</li>
					<li>
						<a href="{:url('admin/index/logout')}">
							<i class="fa fa-power-off"></i>
							安全退出
						</a>
					</li>
					
					
				</ul>
			</div>
		</div>
	</header>

	<div id="page-wrapper" class="container nav-small">
		<div class="row">
			<div id="nav-col">
				<section id="col-left" class="col-left-nano">
					<div id="col-left-inner" class="col-left-nano-content">
						<div id="sidebar-nav">
							<ul class="nav nav-pills nav-stacked">
								{volist name="__menu__" id="nav"}
									{empty name="nav.doc"}
										
										<li class="{$nav['style']}">
											<a href="{$nav['url']|url}">
												<i class="fa fa-{$nav['icon']|default='file'}"></i>
												<span>{$nav['title']}</span>
											</a>
										</li>
										
									{else /}
									<li class="">
										<a href="#" class="dropdown-toggle">
											<i class="fa fa-{$nav['icon']|default='file'}"></i>
											<span>{$nav.title}</span>
											<i class="fa fa-angle-right drop-icon"></i>
									   </a>
										<ul class="submenu">
										{volist name="nav.doc" id="item"}
											<li class="{$item['style']}">
												<a href="{$item['url']|url}">
													<i class="fa fa-{$item['icon']|default='file'}"></i>
													<span>{$item['title']}</span>
												</a>
											</li>
										{/volist}
										</ul>
									</li>
									{/empty}
								{/volist}
							</ul>
						</div>
					</div>
				</section>
			</div>

			<div id="content-wrapper">
				<div class="row">
					<div class="col-lg-12">
						<div class="row">
							<div class="col-lg-12">
								<div id="content-header" class="clearfix">
									<div class="pull-left">
										<ol class="breadcrumb">
											<li>
												<a href="{:url('admin/index/index')}">后台首页</a>
											</li>
											<li class="active">
												{if $meta_title}
												<span>{$meta_title}</span>
												{else/}
												<span>{:lang(request()->controller().'_'.request()->action())}</span>
												{/if}
											</li>
										</ol>
									</div>
									<div class="pull-right hidden-xs">
									</div>
								</div>
							</div>
						</div>
						<div class="row">
							<div class="col-lg-12">
								{block name="body"}{/block}
							</div>
						</div>
					</div>
				</div>
				<!---
				<footer id="footer-bar" class="row">
					
				</footer>--->
			</div>
		</div>
	</div>
</div>
{include file="admin@public/tool" /}
{include file="admin@public/footer" /}
{block name="script"}{/block}